package com.szh.easyexcel.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * Excel上传对应的DTO类
 * 使用了lombok的@Accessors(chain = true) ，无法被Cglib读取
 * 建议使用@Builder来替换@Accessors(chain = true)
 *
 * @author: SongZiHao
 * @date: 2023/5/27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductExcelDto {
    @ExcelProperty(index = 0)
    private Long id;

    @ExcelProperty(index = 1)
    private String name;

    @ExcelProperty(index = 2)
    private String info;

    @ExcelProperty(index = 3)
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    private String buyTime;
}


